<div ng-controller='CourseAdd' class='right-cont'>
    <div class="add-course">
        <div class='title'>
            <div class="title-line" ></div>
            <div class="title-word" >{{title_word}}</div>
        </div>

        <div class='box-cont step1' style="padding: 40px"  >
            <form class="form-horizontal" role="form" enctype="multipart/form-data">
                <div class="form-group" >
                    <label class="col-sm-3 control-label " style="text-align: left">
                        <span class="badge" style="background-color: #09b9a6;margin-right: 8px;">1</span>
                        <span style="color: #000000;font-size: 16px">课程信息</span>
                    </label>
                </div>
                <div class="form-group">
                    <label  class="col-sm-3 control-label" >课程名称：</label>
                    <div class="col-sm-4">
                        <input type="text" class="form-control" ng-model="name" placeholder="请输入课程名称">
                    </div>
                </div>
                <div class="form-group">
                    <label  class="col-sm-3 control-label" >课程价格：</label>
                    <div class="col-sm-4">
                        <input type="number" class="form-control" ng-model="price" placeholder="请输入课程价格">
                    </div>
                </div>
                <div class="form-group">
                    <label  class="col-sm-3 control-label" >课程类型：</label>
                    <div class="col-sm-4">
                        <select class="form-control" ng-model='cate' style="padding:0px 0px 0px 10px">
                            <option  value='0'>音频</option>
                            <option  value='1'>音频PPT</option>
                            <option  value='2'>视频</option>
                        </select>
                    </div>
                </div>
                <div class="form-group">
                    <label  class="col-sm-3 control-label" >章节数量：</label>
                    <div class="col-sm-4">
                        <input type="number" class="form-control" ng-model="chapter" placeholder="请输入章节数量">
                    </div>
                </div>
                <div class="form-group">
                    <label  class="col-sm-3 control-label" >课程介绍：</label>
                    <div class="col-sm-4">
                        <textarea class='form-control' ng-model='decipt' rows="4"></textarea>
                    </div>
                </div>
                <div class="form-group">
                    <label  class="col-sm-3 control-label" >概述图片：</label>
                    <div class="col-sm-4">
                        <input type="text" class="form-control" ng-model="course_add.name" disabled>
                    </div>
                    <div class="col-sm-1">
                        <button class="btn btn-default" ngf-select ng-model="course_add">浏览...</button>
                    </div>
                    <div class="col-sm-1" style="text-align: left">
                        <button class="btn btn-primary" ng-click="submit(course_add,-1,0)">上传</button>
                    </div>
                </div>
                <hr/>

                <div class="form-group">
                    <label class="col-sm-3 control-label " style="text-align: left">
                        <span class="badge" style="background-color: #09b9a6;margin-right: 8px">2</span>
                        主讲人信息
                    </label>
                </div>
                <div class="form-group" style="margin-bottom: 66px">
                    <label  class="col-sm-3 control-label" >主讲人：</label>
                    <div class="col-sm-4">
                        <select class="form-control" ng-model='teacher_id' style="padding: 0">
                            <option ng-repeat='teacher in teachers' value='{{teacher.id}}'>{{teacher.name}}</option>
                        </select>
                    </div>
                </div>
                <div class="form-group">
                    <div class="col-sm-6" style="text-align: right"><input type="reset" class='btn btn-default btn-sm btn-w-sm' value="取消"  style="background-color: #ffffff;color:#3e4855;"></div>
                    <div class="col-sm-6" style=""><button type="button" class='btn btn-primary btn-sm btn-w-sm'  ng-click='to_chapter(1,chapter)'>下一步</button></div>
                </div>
            </form>
        </div>
        <div class='box-cont step2' style="padding: 40px"  >
            <form class="form-horizontal" role="form" enctype="multipart/form-data">
                <div class="form-group" >
                    <label class="col-sm-3 control-label " style="text-align: left">
                        <span style="color: #000000;font-size: 16px">共&nbsp;{{chapter}}&nbsp;讲</span>
                    </label>
                </div>
                <div class="item-chapter" ng-repeat="chapter_detaile in chapter_detailes"  ng-init="attach=false;outerIndex = $index">
                    <div class="form-group" >
                        <label  class="col-sm-1 control-label" >第{{chapter_detaile.num}}讲：</label>
                        <div class="col-sm-5">
                            <input type="text" class="form-control" ng-model="chapter_detaile.name" placeholder="输入章节名称">
                        </div>
                    </div>
                    <div class="form-group" >
                        <div class="col-sm-10 col-md-offset-1">
                            <textarea class='form-control' ng-model='chapter_detaile.introduce' rows="2"></textarea>
                            <!--<input type="text" class="form-control" ng-model="chapter_detaile.introduce" placeholder="输入介绍内容">-->
                        </div>
                    </div>
                    <div class="form-group">
                        <div class="col-sm-2 col-md-offset-1">
                            <input type="text" class="form-control" ng-model="chapter_detaile.voice.name" placeholder="选择音频文件" title="chapter_detaile.voice.name" disabled>
                        </div>
                        <div class="col-sm-1">
                            <button class="btn btn-default" ngf-select ng-model="chapter_detaile.voice">浏览...</button>
                        </div>
                        <div class="col-sm-2">
                            <button class="btn btn-primary" ng-click="submit(chapter_detaile.voice,$index,1)" style="background-color: #01b1fa;border-width: 0px;">上传音频</button>
                        </div>
                        <div class="col-sm-2">
                            <input type="text" class="form-control" ng-model="chapter_detaile.ppt.name" placeholder="请选择PPT" title="chapter_detaile.ppt.name" disabled>
                        </div>
                        <div class="col-sm-1">
                            <button class="btn btn-default" ngf-select ng-model="chapter_detaile.ppt">浏览...</button>
                        </div>
                        <div class="col-sm-2">
                            <button class="btn btn-primary" ng-click="submit(chapter_detaile.ppt,$index,2)"  style="background-color: #01ccb6;border-width: 0px;">上传PPT</button>
                        </div>
                        <div class="col-sm-1" style="font-size: 22px;color: #E6E6E6">
                            <i class="fa fa-plus-circle" style="cursor:pointer;" ng-click="attach=!attach"></i>
                            <!--<i class="fa fa-minus-circle" style="cursor:pointer;"></i>-->
                        </div>
                    </div>
                    <div class="form-group" ng-if="chapter_detaile.ppts">
                        <div class="col-sm-10 col-md-offset-1">
                            <div class="col-sm-3" ng-repeat="ppt in chapter_detaile.ppts">
                                <img ng-src="http://127.0.0.1/xinletu/src/branch/server/{{ppt.path}}" alt="" width="100%">
                                <span>{{ppt.name}}|{{ppt.size}}</span><span>
                            <i class="fa fa-close" style="cursor:pointer;" ng-click="delete_pptFile(ppt.path,outerIndex)"></i></span>
                            </div>
                        </div>
                    </div>
                    <div class="form-group" ng-if="attach">
                        <div class="col-sm-10 col-md-offset-1">
                            <textarea type="text" class="form-control" style="rows:2;" ng-model="chapter_detaile.attach" placeholder="请选择教辅资料，格式为‘资料标题1:资料链接1;资料标题2:资料链接2;’"></textarea>
                        </div>
                        <div class="col-sm-1" style="font-size: 22px;color: red">
                            <!--<i class="fa fa-plus-circle" style="cursor:pointer;" ng-click="attach=!attach"></i>-->
                            <i class="fa fa-close" style="cursor:pointer;" ng-click="attach = false"></i>
                        </div>
                    </div>
                </div>

                <div class="form-group">
                    <div class="col-sm-6" style="text-align: right"><input type="reset" class='btn btn-default btn-sm btn-w-sm' value="取消"  style="background-color: #ffffff;color:#3e4855;"></div>
                    <div class="col-sm-6" style=""><button type="button" class='btn btn-primary btn-sm btn-w-sm'  ng-click='savecourse()'>完成</button></div>
                </div>
            </form>
        </div>
    </div>
    <!--
    <img src="{{uploadImg}}"/>
    &lt;!&ndash;当前上传用户:<input type="text" placeholder="请输入您的名称" name="name" ng-model="username"/>&ndash;&gt;
    <div class="button" ngf-select ng-model="file">Select</div>
    <button type="submit" ng-click="submit()">submit</button>
    {{fileInfo.name}}<br/>
    {{fileInfo.size}}-->


</div>